Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use listUsersPaginated instead of deprecated listUsers #50

Merged
merged 5 commits into from
Aug 20, 2024

Conversation

enzomerca
Copy link
Contributor

What problem is this solving?

Use listUsersPaginated instead of deprecated listUsers.

This includes the following changes:

  • Fix tokens provided on requests to storefront-permissions (provide app auth token)
  • Refactor getUsers to getOrgSalesAdminEmail.
  • Provide the organization id when querying users in order to send e-mail only to sales-admin users of that organization.
  • Query only the email on listUsersPaginated as this is the only information currently used.
  • Query only the first page (25 users) as it is very unlikely we will have 25+ sales-admin for a single organization (this helps to keep the code simple).

Note: This PR does not implement pagination for the listUsersPaginated query, if this is needed in the future, proper pagination must be implemented.

@enzomerca enzomerca requested a review from a team August 15, 2024 14:03
Copy link

vtex-io-ci-cd bot commented Aug 15, 2024

Hi! I'm VTEX IO CI/CD Bot and I'll be helping you to publish your app! 🤖

Please select which version do you want to release:

  • Patch (backwards-compatible bug fixes)

  • Minor (backwards-compatible functionality)

  • Major (incompatible API changes)

And then you just need to merge your PR when you are ready! There is no need to create a release commit/tag.

  • No thanks, I would rather do it manually 😞

Copy link

github-actions bot commented Aug 15, 2024

Messages
📖 ❤️ Thanks!
📖

🎉 PR additions = 33, PR deletions = 31

Generated by 🚫 dangerJS against c005049

Copy link

@enzomerca enzomerca merged commit 58cc092 into master Aug 20, 2024
13 checks passed
@enzomerca enzomerca deleted the fix/B2BTEAM-1829-use-list-users-paginated branch August 20, 2024 16:46
Copy link

vtex-io-ci-cd bot commented Aug 20, 2024

Your PR has been merged! App is being published. 🚀
Version 2.5.3 → 2.5.4

After the publishing process has been completed (check #vtex-io-releases) and doing A/B tests with the new version, you can deploy your release by running:

vtex deploy [email protected]

After that your app will be updated on all accounts.

For more information on the deployment process check the docs. 📖

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants